package com.lin.springcloudalibaba.controller;

import com.lin.springcloudalibaba.entities.CommonResult;
import com.lin.springcloudalibaba.entities.Payment;
import com.lin.springcloudalibaba.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: lin
 * @description:
 * @time: 2021/8/18 9:31
 */
@RestController
@Slf4j
public class OrderFeignController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id)
    {
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping(value = "consumer/payment/feign/timeout")
    public String paymentFeingnTimeout(){

        return paymentFeignService.paymentFeignTimeout();
    }
}
